Encoding:

P32A

001000

rt

rs

rd

ADDU.QB

0

0011001

101

P32A

001000

rt

rs

rd

ADDU_S.QB

1

0011001

101

6

5

5

5

1

7

3

Format:

ADDU[_S].QB 

Unsigned Add Quad Byte Vectors

ADDU.QB   rd, rs, rt

DSP

Unsigned Add Quad Byte Vectors

ADDU_S.QB rd, rs, rt

DSP

Unsigned Add Quad Byte Vectors

Purpose:

Unsigned Add Quad Byte Vectors

Element-wise addition of two vectors of unsigned byte values to prod uce a vector of unsigned byte result s, with optional saturation.

Description:

rd = sat8(rs31..24 + rt31..24) || sat8(rs23..16 + rt23..16) || sat8(rs15..8 + 
rt15..8) || sat8(rs7..0 + rt7..0)

The four byte elements in register rt are added to the corresponding byte elements in register rs.

For the non-saturating version of the instruction, the result modulo 256 is written into the corresponding element in register rd.

For the saturating version of the instruction, the addition is performed using unsigned saturating arithmetic. Results that overflow are clamped to the largest representable value (255 decimal, 0xFF hexadecimal) before being written to the destination register rd.

For either instruction, if any of the individual additions result in overflow or saturation, a 1 is written to bit 20 in the

DSPControl register within the ouflag field.

Restrictions:

No data-dependent exceptions are possible.

The operands must be values in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.

Operation:

ADDU.QB:
   ValidateAccessToDSPResources()
   tempD7..0 = addU8( GPR[rs]31..24 , GPR[rt]31..24 )
   tempC7..0 = addU8( GPR[rs]23..16 , GPR[rt]23..16 )
   tempB7..0 = addU8( GPR[rs]15..8 , GPR[rt]15..8 )
   tempA7..0 = addU8( GPR[rs]7..0 , GPR[rt]7..0 )
   GPR[rd]31..0 = tempD7..0 || tempC7..0 || tempB7..0 || tempA7..0
ADDU_S.QB:
   ValidateAccessToDSPResources()
   tempD7..0 = satAddU8( GPR[rs]31..24 , GPR[rt]31..24 )
   tempC7..0 = satAddU8( GPR[rs]23..16 , GPR[rt]23..16 )
   tempB7..0 = satAddU8( GPR[rs]15..8 , GPR[rt]15..8 )
   tempA7..0 = satAddU8( GPR[rs]7..0 , GPR[rt]7..0 )
   GPR[rd]31..0 = tempD7..0 || tempC7..0 || tempB7..0 || tempA7..0
   if ( temp8 = 1 ) then
      DSPControlouflag:20 = 1
   endif
   return temp7..0
endfunction addU8
function satAddU8( a7..0, b7..0 )
   temp8..0 = ( 0 || a7..0 ) + ( 0 || b7..0 )
   if ( temp8 = 1 ) then
      temp7..0 = 0xFF
      DSPControlouflag:20 = 1
   endif
   return temp7..0
endfunction satAddU8

Exceptions:

Reserved Instruction, DSP Disabled